<template>
  <div>
    <el-pagination @current-change="handleCurrentChange" background layout="prev, pager, next" :total='50'>
    </el-pagination>
  </div>
</template>

<script>
import {getUserListApi,getUserTotalApi} from '../../../api/userApi'
export default {
  data() {
    return {
      num:1,
      tableData:[]
    }
  },
  async mounted() {
    // let res = await getUserListApi()
    // this.num=res.data
    this.getuser()
    let res = await getUserTotalApi()
    this.num=res.data
    },
    methods: {
      
      async getuser(page){
        let res = await getUserListApi(page)
        this.tableData = res.data.userlist
        console.log(this.tableData)
      },
      handleCurrentChange(page){
        this.getuser(page)
        this.$emit('handleCurrentChange',this.tableData)
      },
    },
   
   
};
</script>

<style lang="scss" scoped>
::v-deep{
    .el-pagination{
        margin-top: 20px;
        margin-left: 350px;
    }
}
</style>